π macOS Network Reset Commands β Quick Reference
Β· One min read
In most cases, running DNS flush + DHCP reset is enough to fix the majority of network issues.
Common Commands (in recommended order)β
1. Flush DNS Cacheβ
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
2. Release and Renew IP Address (DHCP)β
sudo ipconfig set en0 DHCP
3. Restart Wi-Fiβ
networksetup -setairportpower en0 off && networksetup -setairportpower en0 on
4. Restart Network Interfaceβ
sudo ifconfig en0 down && sudo ifconfig en0 up
π§ Full Network Settings Reset (more thorough)β
Delete network preference files β they will be automatically rebuilt after reboot:
sudo rm /Library/Preferences/SystemConfiguration/com.apple.network.identification.plist
sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo rm /Library/Preferences/SystemConfiguration/preferences.plist
β οΈ Note: A Mac restart is required after running these. All network configurations will be reset to defaults β Wi-Fi and other settings will need to be reconfigured.
π Notesβ
| Interface | Description |
|---|---|
en0 | Usually the Wi-Fi wireless adapter |
en1 | Usually the wired Ethernet adapter |
If you're unsure of your interface name, run ifconfig to check.